package com.design.movieticket.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.design.movieticket.dto.MovieDto;
import com.design.movieticket.entity.Movie;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface MovieMapper extends BaseMapper<Movie> {
    @Select("select id,movie_name,still from movie where play_status = 1 and del_flag = 0")
    public List<MovieDto> wxGetMovieListForHot();

    @Select("select id,movie_name,still from movie where play_status = 0 and del_flag = 0")
    public List<MovieDto> wxGetMovieListForFuture();

    @Select("select * from movie where movie_name in " +
            "(select distinct movie_name from movie_arrange where movie_hall_id in " +
            "(select id from movie_hall where cinema_id = #{cinemaId} and status = 1 and del_flag = 0) and del_flag = 0) " +
            "and del_flag = 0 and play_status != 2")
    List <MovieDto> wxGetMovieListByCinemaId(Long cinemaId);
}
